# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Wael Nasreddine <gandalf@siemens-mobiles.org>

pkgname=perl-inline-java
pkgver=0.67
pkgrel=2
pkgdesc="The Inline::Java module allows you to put Java source code directly inline in a Perl script or module."
arch=('loong64' 'x86_64')
depends=('perl' 'perl-inline' 'java-runtime')
makedepends=('java-environment=11' 'perl-file-which')
license=("GPL" "PerlArtistic")
url="https://search.cpan.org/dist/Inline-Java"
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/E/ET/ETJ/Inline-Java-$pkgver.tar.gz)
sha256sums=('f5854b31cbce163c33e2624dd2314e0c0d97e0944371b7188e5901ba3f6fa4c9')

build() {
  cd "$srcdir"/Inline-Java-$pkgver
  PERL_USE_UNSAFE_INC=1 \
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor J2SDK=/usr/lib/jvm/java-11-openjdk
#  make java
  make
}
package() {
  cd "$srcdir"/Inline-Java-$pkgver
  make install DESTDIR="$pkgdir"
  find "$pkgdir" -name '.packlist' -delete
  find "$pkgdir" -name '*.pod' -delete
}
